#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long LL;
const int N = 2e6 + 10;
void solve() {
    int n,m;
    cin >> n >> m;
    vector<int> arr(m + 10);
    map<int,int> mp;
    int maxc = 0;
    for(int i = 1; i <= m; i ++)
    {
        cin >> arr[i];
        mp[arr[i]] ++;
        maxc = max(maxc,arr[i]);
    }
    for(auto x : mp)
    {
        if(x.second >= 2)
        {
            cout << 1 << endl;
            return;
        }
    }
    for(int i = 1; i <= m - 1; i ++)
    {
        if(arr[i + 1] - arr[i] != 1)
        {
            cout << 1 << endl;
            return;
        }
    }
    cout << n - maxc + 1 << endl;
}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--)
    {
        solve();
    }
}